package org.redr.widgetGUI.core;

import org.redr.widgetGUI.settings.WidgetSettings;
import org.redr.widgetGUI.settings.WidgetState;

import com.trolltech.qt.gui.QLabel;
import com.trolltech.qt.gui.QLayout;

public class WidgetLabel extends WidgetState{
	QLabel label;
	
	public QLabel widget(){
		return label;
	}
	
	public WidgetLabel(LayoutState p, WidgetSettings ws){
		super(p, ws);
		label = new QLabel();
		p.addWidget(label);
		_loadSettings();
	}
	
	private void _loadSettings() {
		label.clear();
		label.setText(_getSetting("label", ""));
	}

	public WidgetLabel(QLayout layout, WidgetSettings ws){
		super(layout, ws);
	}
	
	public void setText(String t){
		label.setText(t);
		this._setSetting("label", t);
	}
}
